/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package skyproc;

/**
 *
 * @author Justin Swanson
 */
public class LVLI extends LeveledRecord {

    SubForm LVLG = new SubForm(Type.LVLG);

    static Type[] types = {Type.LVLI};

    LVLI () {
	super();
	init();
    }

    /**
     * Creates a new LVLI record with a FormID originating from the mod parameter.
     * @param modToOriginateFrom Mod to mark the LVLI as originating from.
     * @param edid EDID to assign the record.  Make sure it's unique.
     */
    public LVLI(Mod modToOriginateFrom, String edid) {
        super(modToOriginateFrom, edid);
        init();
    }

    final void init() {
	subRecords.add(OBND);
	subRecords.add(LVLD);
	subRecords.add(LVLF);
	subRecords.add(LVLG);
	subRecords.add(entries);
    }

    //SkyBash merger
    /**
     * Merges Major Records.
     *
     * @param no The new MajorRecord to be merged.
     * @param bo The base MajorRecord, to prevent base data from being
     * re-merged.
     * @return The modified MajorRecord.
     */
    @Override
    public MajorRecord merge(MajorRecord no, MajorRecord bo) {
        super.merge(no, bo);
        LVLI l = this;
        if (!(no == null && bo == null && (no instanceof LVLI) && (bo instanceof LVLI))) {
            final LVLI nl = (LVLI) no;
            final LVLI bl = (LVLI) bo;
            l.LVLG.merge(nl.LVLG, bl.LVLG);
        }
        return l;
    }

    @Override
    Type[] getTypes() {
	return types;
    }

    @Override
    Record getNew() {
	return new LVLI();
    }

    /**
     *
     * @param id
     */
    public void setGlobalForm (FormID id) {
	LVLG.setForm(id);
    }

    /**
     * s
     * @return
     */
    public FormID getGlobalForm () {
	return LVLG.getForm();
    }

}
